import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { LoginComponent} from '../components/login/login';
import { HomeComponent} from '../components/home/home';
import { Loginauth} from '../service/loginauth';
import {UpdatepswComponent} from '../components/updatepsw/updatepsw';

const routes: Routes = [
  {path : '', redirectTo: '/index', pathMatch: 'full'},
  {path : 'home', component: HomeComponent, canActivate: [Loginauth] },
  {path : 'login', component: LoginComponent},
  {path: 'updatepsw', component: UpdatepswComponent},
];

@NgModule({
  imports: [ RouterModule.forRoot(routes) ],
  exports: [ RouterModule ]
})
export class AppRoutingModule {}
